package com.verbetia.musictrends.web.music;

import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.verbetia.musictrends.persistence.hsqldb.MusicEntity;
import com.verbetia.musictrends.persistence.hsqldb.MusicsPersMngr;
import com.verbetia.musictrends.persistence.hsqldb.UserEntity;
import com.verbetia.musictrends.persistence.hsqldb.Utils;

public class UserIndex extends HttpServlet{

	private boolean authenticated = false;
	
	String userid;
	String username;
	UserEntity profile = null;			
	ArrayList<MusicEntity> songs = null;
	
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 
	{
		profile = new UserEntity();
		profile.setUserid("1");
		profile.setUsername("gipsh");
			
//		UserEntity userProfile = (UserEntity)o;
		
		
		System.out.println(profile.getUserid());
		
		
		MusicsPersMngr music = new MusicsPersMngr();
				
		
        try  			
        {
		 songs = 	Utils.rs2MusicEntity(
				 			music.selectQuery(profile.getUserid(), 0)
				);
        } catch (SQLException sqle)
        {
        	System.out.println(sqle);
        }
        
       
		
			
    }

}
